Tools Plus for THINK Pascal and Tools Plus for THINK C are located in two separate folders. Tools Plus is made up of the following items:
“ToolsPlus.Lib1” Library containing Tools Plus routines (1 of 3)
“ToolsPlus.Lib2” Library containing Tools Plus routines (2 of 3)
“ToolsPlus.Lib3” Library containing Tools Plus routines (3 of 3)
“ToolsPlus.h” C header file for Tools Plus
(C only)
“ToolsPlus.c” Source code for routines that must be compiled with
your application. These routines will be compiled
according to your project’s compiler settings for
680x0 processor and/or math co-processor
optimization.
(C only)
“ToolsPlus.p” Pascal interface file for Tools Plus
(Pascal only)
“Palette WDEF” Optional resource file containing the WDEF resource
(window definition) for floating palettes. Found in
the “Optional Resources” folder.
“Demos” Folder containing a demo application and its source
code
Installing Tools Plus for THINK C
`````````````````````````````````
This User Manual is also part of the Tools Plus package. Drag the ToolsPlus.Lib1, ToolsPlus.Lib2 and ToolsPlus.Lib3 libraries into the C Libraries folder, and ToolsPlus.h into the Mac #includes folder, or where ever you keep your other libraries and header files. You can drag the ToolsPlus.c file into your C Libraries folder, even though it is not a library. Keeping it with the ToolsPlus.Lib1, ToolsPlus.Lib2 and ToolsPlus.Lib3 libraries will help to remind you to include ToolsPlus.c in your project.
Adding Tools Plus to a THINK C Project
``````````````````````````````````````
To add Tools Plus to a THINK C project, first open your project, then use the Source menu’s Add… command to add the file ToolsPlus.Lib1, ToolsPlus.Lib2, ToolsPlus.Lib3, and ToolsPlus.c.
Though libraries can be located anywhere in your project, placing them at the top will organize it a little better. Drag each of the libraries (ToolsPlus.Lib1, ToolsPlus.Lib2, and ToolsPlus.Lib3) into their own segment. For convenience, drag ToolsPlus.c to the segment containing the last Tools Plus library.
Tools Plus Segments in THINK C
``````````````````````````````
The segments containing Tools Plus libraries will be constantly accessed while your application is running. It is preferable to pre-load those segments by flagging them as “Preload.”
Warning: Do not unload the segments containing Tools Plus libraries.
You can ensure that this doesn’t happen accidentally by
This User Manual is also part of the Tools Plus package. Drag the ToolsPlus.Lib1, ToolsPlus.Lib2, and ToolsPlus.Lib3 libraries into the Libraries folder, and ToolsPlus.p into the Interface folder, or where ever you keep your other libraries and interfaces.
Adding Tools Plus to a THINK Pascal Project
```````````````````````````````````````````
To add Tools Plus to a THINK Pascal project, first open your project, then use the Project menu’s Add File command to add the files ToolsPlus.Lib1, ToolsPlus.Lib2, ToolsPlus.Lib3, and ToolsPlus.p to your project.
Build Order…
Though libraries can be located anywhere in your build order,
placing them near the top (early in the compiling order) will
organize your project a little better. The ToolsPlus.p interface
has to be compiled BEFORE your source code makes reference to it.
Placing it immediately below the libraries is a good, safe place
By Segment…
Drag each of the Tools Plus libraries into their own segment. For
convenience, drag the ToolsPlus.p interface file into the segment
containing the last Tools Plus library.
After Compiling
```````````````
So far, you’ve told THINK Pascal what files to use and the order in which they should be compiled. When you compile your project the first time, THINK Pascal loads the specified libraries and integrates them into your project file, and it compiles source files (including ToolsPlus.p) and integrates them in your project file. After your first compile, you’ll notice that THINK Pascal automatically added several items to your project file:
«ToolsPlus.Lib1:1»
«ToolsPlus.Lib2:1»
«ToolsPlus.Lib3:1»
«%_MethTables»
«%_SelProcs»
«%_Profiler»
The «ToolsPlus.Lib1:1», «ToolsPlus.Lib2:1» and «ToolsPlus.Lib3:1» items contain the object code from the Tools Plus libraries, while «%_MethTables», «%_SelProcs» and «%_Profiler» items are part of THINK Pascal’s overhead (consult your THINK Pascal User Manual for details).
Drag «ToolsPlus.Lib1:1» into the same segment as ToolsPlus.Lib1, «ToolsPlus.Lib2:1» into the same segment as ToolsPlus.Lib2, etc.
Drag «%_MethTables», «%_SelProcs» and «%_Profiler» to any segment that won’t be unloaded while your application is running, such as the one containing the Runtime.lib library.
Even though the project window indicates that Segment 1 exceeds the 32k limit imposed on segments, the project will compile and run. When you build your application, the smart linker will strip away unneeded code and significantly reduce the size of this segment.
Note: Tools Plus does not have a dependency on the Runtime.lib library.
Unless your application needs routines that are found only in the
full Runtime.lib library, you can use the smaller µRuntime.lib
library instead
Tools Plus Segments in THINK Pascal
```````````````````````````````````
The segments containing Tools Plus libraries will be constantly accessed while your application is running. It is preferable to pre-load those segments by flagging them as “Preload.”
Warning: Do not unload the segments containing Tools Plus libraries.
You can ensure that this doesn’t happen accidentally by
The easiest way to compile the C demo application included with Tools Plus is to have the following files in the same folder:
Demo.π
Demo.π.rsrc
Demo.c
ToolsPlus.Lib1
ToolsPlus.Lib2
ToolsPlus.Lib3
ToolsPlus.h
ToolsPlus.c
PascalStrHandles.c
Double-click the Demo.π project file to launch THINK C, then run your project.
Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and their related files in their permanent folders. Create a new project named “Demo.π” in the same folder as “Demo.π.rsrc” and “PascalStrHandles.c”. Add the following files to your new project:
Segment 1: MacTraps
MacTraps2
Segment 2: ANSI
Segment 3: ToolsPlus.Lib1
Segment 4: ToolsPlus.Lib2
Segment 5: ToolsPlus.Lib3
ToolsPlus.c
Demo.π.rsrc (add this file only if you are running
THINK C 6.0.1 or higher)
Segment 6: Demo.c
You can now build your project and run your application.
The easiest way to compile the Pascal demo application included with Tools Plus is to have the following files in the same folder:
Demo.π
Demo.π.rsrc
Demo.p
ToolsPlus.Lib1
ToolsPlus.Lib2
ToolsPlus.Lib3
ToolsPlus.p
Double-click the Demo.π project file to launch THINK Pascal, then run your project.
Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and their related files in their permanent folders. Create a new project named “Demo.π” in the same folder as “Demo.π.rsrc”. Add the following files to your new project:
Segment 1: Runtime.Lib
Interface.Lib
Segment 2: ToolsPlus.Lib1
Segment 3: ToolsPlus.Lib2
Segment 4: ToolsPlus.Lib3
ToolsPlus.p
Segment 5: Sound.p
Demo.p
You can now build your project. After the initial compile, you will notice THINK Pascal created some additional entries in your project file:
«ToolsPlus.Lib1:1»
«ToolsPlus.Lib2:1»
«ToolsPlus.Lib3:1»
«%_MethTables»
«%_SelProcs»
«%_Profiler»
The «ToolsPlus.Lib1:1», «ToolsPlus.Lib2:1» and «ToolsPlus.Lib3:1» items contain the object code from the Tools Plus libraries, while «%_MethTables», «%_SelProcs» and «%_Profiler» items are part of THINK Pascal’s overhead (consult your THINK Pascal User Manual for details).
Drag «ToolsPlus.Lib1:1» into the same segment as ToolsPlus.Lib1, «ToolsPlus.Lib2:1» into the same segment as ToolsPlus.Lib2, and «ToolsPlus.Lib3:1» into the same segment as ToolsPlus.Lib3.
Drag «%_MethTables», «%_SelProcs» and «%_Profiler» to any segment that won’t be unloaded while your application is running, such as the one containing the Runtime.lib library.
Even though the project window indicates that Segment 1 exceeds the 32k limit imposed on segments, the project will compile and run. When you build your application, the smart linker will strip away unneeded code and significantly reduce the size of this segment.